import request from '@/utils/request'

// 创建线路
export function createLine(data) {
  return request({
    url: '/team/line/create',
    method: 'post',
    data: data
  })
}

// 更新线路
export function updateLine(data) {
  return request({
    url: '/team/line/update',
    method: 'put',
    data: data
  })
}

// 删除线路
export function deleteLine(id) {
  return request({
    url: '/team/line/delete?id=' + id,
    method: 'delete'
  })
}

/** 批量删除线路 */
export function deleteLineList(ids) {
  return request({
    url: `/team/line/delete-list?ids=${ids.join(',')}`,
    method: 'delete'
  })
}

// 获得线路
export function getLine(id) {
  return request({
    url: '/team/line/get?id=' + id,
    method: 'get'
  })
}

// 获得线路分页
export function getLinePage(params) {
  return request({
    url: '/team/line/page',
    method: 'get',
    params
  })
}
// 导出线路 Excel
export function exportLineExcel(params) {
  return request({
    url: '/team/line/export-excel',
    method: 'get',
    params,
    responseType: 'blob'
  })
}